import os

def ScanFolder(path):
    fileList = []
    
    for item in os.listdir(path):
        filePath = os.path.join(path, item)
        
        if os.path.isfile(filePath):
            fileList.append(filePath)
        if os.path.isdir(filePath):
            ScanFolder(filePath)

    if (len(fileList) > 0):
        potentialFiles = filter(lambda c:c.find('Potential') > -1 and c.find('.pdf') > -1, fileList)
        detailFiles = filter(lambda c:c.find('DetailRpt') > -1 and c.find('.pdf') > -1, fileList)
        powerFiles = filter(lambda c:c.find('PowerName') > -1 and c.find('.pdf') > -1, fileList)
        mapFiles = filter(lambda c:c.find('OverviewMap') > -1 and c.find('.pdf') > -1, fileList)

        inputFiles = potentialFiles + detailFiles + powerFiles + mapFiles
        if (len(inputFiles) > 0):
            if not potentialFiles:
                print 'Miss potential at ' + path
            if not detailFiles:
                print 'Miss detail at ' + path
##            if not powerFiles:
##                print 'Miss power at ' + path
##            if not mapFiles:
##                print 'Miss map at ' + path


if __name__ == "__main__":
    reportPath = 'D:\\Agent Lead\\Site\\download\\Report'

    try:
        ScanFolder(reportPath)
        
    except Exception as e:
        print e
        




        
